-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
chore(aws): Remove manual span creation #17310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
packages/aws-serverless/src/sdk.ts
Outdated
/** | ||
* Automatically trace all handler invocations. | ||
* You may want to disable this if you use express within Lambda. | ||
* @default true | ||
*/ | ||
startTrace: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed offline: This is a breaking change so we can't just remove it. Let's mark this field as deprecated and add a warning log when it's used.
packages/aws-serverless/src/sdk.ts
Outdated
@@ -45,6 +45,11 @@ export interface WrapperOptions { | |||
* @default false | |||
*/ | |||
captureAllSettledReasons: boolean; | |||
/** | |||
* @deprecated This option has no effect since OpenTelemetry always traces the handler. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l: Let's also mention that this will be removed in a future major and also add a TODO(v11) comment above.
packages/aws-serverless/src/sdk.ts
Outdated
consoleSandbox(() => { | ||
// eslint-disable-next-line no-console | ||
console.warn( | ||
'The `startTrace` option is deprecated and has no effect since OpenTelemetry always traces the handler. If you want to disable tracing, set `SENTRY_TRACES_SAMPLE_RATE` to `0.0`.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l: Same as above
packages/aws-serverless/src/sdk.ts
Outdated
const options: WrapperOptions = { | ||
flushTimeout: 2000, | ||
callbackWaitsForEmptyEventLoop: false, | ||
captureTimeoutWarning: true, | ||
timeoutWarningLimit: 500, | ||
captureAllSettledReasons: false, | ||
startTrace: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l: And also let's add a TODO comment here and mention that this has no effect now but is kept in here for typing reasons.
22643ef
to
0be3063
Compare
0be3063
to
bccae5f
Compare
the TODO says this is likely not needed anymore since OTel correctly wraps the handler in all cases (I never ran into any situation where it didn't).
Also, when a user would use
Sentry.wrapHandler
manually, the detection mechanism checking whether the handler was already wrapped by OTel would not work anyway, since it that case OTel wraps it only after we did, resulting in double spans.Also also, removing this makes our lives easier for streaming, where this resulted in some issues with overlapping spans.